axios.defaults.baseURL = '/SchoolJspDemo_war_exploded'
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
axios.defaults.transformRequest = [function (data) {

    let ret = '';
    for (let it in data) {
        ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
    }
    return ret
}];

function isTelephone(value) {
    if (/^(1[3|5|7|8|9][0-9])\d{8}$/.test(value)) {
        return true;
    }
    return false;
}/*正则表达判断是否为手机号*/

function isEmpty() {
    let size = arguments.length;//获取大小
    if (size === 0)
        return true;
    let i = 0;
    for (; i < size; i++) {
        if (arguments[i] === undefined || arguments[i].length === 0) {
            return true
        }
    }
    return false
};

/**
 * 判断传递的字符串是否在指定范围内
 * @param min
 * @param max
 * @returns {boolean}
 */
function isBounds(min, max) {
    let size = arguments.length;//获取大小
    if (size === 0)
        return true;
    let i = 0;
    for (; i < size; i++) {
        if (arguments[i].length > max || arguments[i].length < min) {
            return true
        }
    }
    return false
};

function isEmail() {
    let size = arguments.length;//获取大小
    if (size === 0)
        return true;
    let i = 0;
    for (; i < size; i++) {
        if (!/(^([0-9]|[a-zA-Z])+@([0-9]|[a-zA-Z])+\.(com|cn|net|top|org)$)/.test(arguments[i])) {
            return true
        }
    }
    return false
};
